"""
边缘检测测试工具 - 测试悬浮按钮的边缘检测和收缩功能
"""

import sys
from PyQt5.QtWidgets import QApplication, QDesktopWidget
from PyQt5.QtCore import Qt
from app_launcher_fluent import FloatingButton

if __name__ == "__main__":
    app = QApplication(sys.argv)
    
    # 创建悬浮按钮
    floating_button = FloatingButton()
    
    # 设置初始位置 - 屏幕右侧中间
    screen = QDesktopWidget().screenGeometry()
    x = screen.width() - 80
    y = screen.height() // 2 - 30
    floating_button.move(x, y)
    
    # 显示按钮
    floating_button.show()
    
    print("测试边缘检测功能:")
    print("1. 将按钮拖到屏幕右侧或左侧边缘")
    print("2. 按钮应自动收缩为原始宽度的1/3")
    print("3. 鼠标悬停在收缩的按钮上，按钮应恢复原始大小")
    print("4. 鼠标离开后，按钮应再次收缩")
    
    sys.exit(app.exec_())
